#!/bin/sh
#
# chkconfig: - 99 99
# description: svtbj's Emark Query Server.
#


# Source function library.
if [ -f /etc/init.d/functions ] ; then
  . /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
  . /etc/rc.d/init.d/functions
else
  exit 1
fi

RETVAL=0
EMARK_DIR=/home/emark

start() {
    KIND="EMARKD"
	echo -n $"Starting $KIND services: "
	daemon $EMARK_DIR/Web
	RETVAL=$?
	echo
	return $RETVAL
}	

stop() {
	KIND="EMARKD"
	echo -n $"Shutting down $KIND services: "
	killproc emarkd
	RETVAL=$?
	echo
	return $RETVAL
}	

restart() {
	stop
	start
}	

rhstatus() {
	status -l emarkd emarkd
	return $?
}	

case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  restart)
  	restart
	;;
  status)
  	rhstatus
	;;
  *)
	echo $"Usage: $0 {start|stop|restart|status}"
	exit 2
esac

exit $?
